<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('strator_has_positions', function (Blueprint $table) {
            $table->id();

            $table->unsignedInteger('strator_id')->index()->comment('管理员id');
            $table->unsignedInteger('position_id')->comment('职务角色id');

            $table->timestamps();
            $table->softDeletes();
        });

        \DB::statement("ALTER TABLE `strator_has_positions` comment '管理员与职务角色对应表'");
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('strator_has_positions');
    }
};
